<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>客户列表-增加</title>
	<link rel="stylesheet" type="text/css" href="../resource/css/base.css" />
	<s:actionmessage/>
		<script type="text/javascript">
			function sumbit(){
				var form = document.forms[0];
				if(form.clientName.value == ""){
					alert("请输入单位名称.");
					return false;
				}
				if(form.linkman.value == ""){
					alert("请输入联系人.");
					return false;
				}
				if(form.phone.value == ""){
					alert("请输入联系电话.");
					return false;
				}
				var reg = /^((\d{11})|^((\d{7,8})|(\d{3,4})-(\d{7,8})|(\d{3,4})-(\d{7,8})-(\d{1,4})|(\d{7,8})-(\d{1,4}))$)$/;
				if(!reg.test(form.phone.value)){
					alert("联系电话输数据有误,请重新输入.");
					return false;
				}
				form.action="add.action";
				form.submit();
			}
		</script>
</head>
<body  oncontextmenu="return false;" leftmargin="8" topmargin="8">
<div class="tip"><span>当前位置:</span>客户管理&nbsp;&gt;&nbsp;新增&nbsp;&gt;&nbsp;</div>
<s:form name="add" namespace="/clientele">
<table class="edittb" cellpadding="2" cellspacing="1">
	<tr bgcolor="#EEF4EA">
		<td height="35" colspan="4">&nbsp;客户信息&nbsp;</td>
	</tr>
	<tr>
		<td class="coln"><SPAN style="color: red">*</SPAN> 单位名称</td>
		<td colspan="3" class="colv">
			<s:textfield name="clientName"></s:textfield>
		</td>
	</tr>
	<tr>
		<td class="coln"><SPAN style="color: red">*</SPAN> 联 系 人</td>
		<td width="35%" class="colv">
			<s:textfield name="linkman"></s:textfield>
		</td>
		<td class="coln"><SPAN style="color: red">*</SPAN> 联系电话</td>
		<td width="45%" class="colv">
			<s:textfield name="phone"></s:textfield>
		</td>
	</tr>
	<tr>
		<td class="coln">单位地址</td>
		<td colspan="3" class="colv">
			<s:textarea name="address"></s:textarea>
		</td>
	</tr>
	<tr align="right" bgcolor="#EEF4EA">
		<td height="35" colspan="4" align="center">
			<a href="javascript:history.go(-1)" class="coolbg">&nbsp;返&nbsp;回&nbsp;</a>
			<a href="#" class="coolbg" onclick="sumbit();">&nbsp;保&nbsp;存&nbsp;</a>
			<a href="javascript:document.forms[0].reset()" class="coolbg">&nbsp;重&nbsp;置&nbsp;</a>
		</td>
	</tr>
</table>
</s:form>
</body>
</html>
